-- GENERATED SPELL FOR [Tortured Earth Spirit] --


function spell0_17156(pUnit, Event) --@Earth Shock,n/a--
pUnit:FullCastSpellOnTarget(13728,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17156', 2271, 1)
end

function spell1_17156(pUnit, Event) --@Frenzy,Self--
pUnit:FullCastSpellOnTarget(3019,pUnit)
pUnit:RegisterEvent('Sorts_17156', 15000, 1)
end

function Sorts_17156(pUnit, Event)
local choix_sorts_17156 = math.random(0, 1)
if choix_sorts_17156 == 0 then
pUnit:RegisterEvent('spell0_17156', 1, 1)
end
if choix_sorts_17156 == 1 then
pUnit:RegisterEvent('spell1_17156', 1, 1)
end
end

function mob17156_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17156', math.random(1500, 3000), 1)
end

function mob17156_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17156_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17156_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17156, 1, 'mob17156_Action')
RegisterUnitEvent(17156, 2, 'mob17156_Leave')
RegisterUnitEvent(17156, 3, 'mob17156_Kill')
RegisterUnitEvent(17156, 4, 'mob17156_Die')
